package com.learn.java3y.java.generics;

public class ObjectToolTest {

    public static void main(String[] args) {
        // 创建对象并指定元素类型
        ObjectTool<String> tool = new ObjectTool<>();
        tool.setObj("测试");
        String obj = tool.getObj();
        System.out.println(obj);

        ObjectTool<Integer> objectTool = new ObjectTool<>();
        objectTool.setObj(10);
        Integer obj1 = objectTool.getObj();
        System.out.println(obj1);

    }

}
